package com.shpng.cheapenglish.entity;

import com.shpng.cheapenglish.db.UserWord;

public class SUserWord {

	private UserWord dbUserWord;

	private SUserUnit userUnit;

	private SWord word;

	public SUserWord(UserWord userWord, SUserUnit userUnit, SWord word) {
		this.dbUserWord = userWord;
		this.userUnit = userUnit;
		this.word = word;
	}

	public SUser getUser() {
		return userUnit.getUser();
	}

	public SUserUnit getUserUnit() {
		return userUnit;
	}

	public void setUserUnit(SUserUnit userUnit) {
		this.userUnit = userUnit;
		if (userUnit.getId() != dbUserWord.getUnitId())
			dbUserWord.setUnitId(userUnit.getId());
	}

	public SWord getWord() {
		return word;
	}

	public void setWord(SWord word) {
		this.word = word;
		if (word.getId() != dbUserWord.getWordId())
			dbUserWord.setWordId(word.getId());
	}

	public void setId(Long id) {
		dbUserWord.setId(id);
	}

	public long getWordId() {
		return dbUserWord.getWordId();
	}

	public void setWordId(long wordId) {
		dbUserWord.setWordId(wordId);
	}

	public int getReciteTimes() {
		return dbUserWord.getReciteTimes();
	}

	public void setReciteTimes(int reciteTimes) {
		dbUserWord.setReciteTimes(reciteTimes);
	}

	public int getAverageDegree() {
		return dbUserWord.getAverageDegree();
	}

	public void setAverageDegree(int averageDegree) {
		dbUserWord.setAverageDegree(averageDegree);
	}

	public long getUnitId() {
		return dbUserWord.getUnitId();
	}

	public void setUnitId(long unitId) {
		dbUserWord.setUnitId(unitId);
	}

	public long getId() {
		return dbUserWord.getId();
	}

	public UserWord getDbUserWord() {
		return dbUserWord;
	}

}
